FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block prometheus_cadvisor_header %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% block prometheus_cadvisor_repository_version %}
ARG prometheus_cadvisor_version=0.47.2
{% if debian_arch == 'arm64' %}
ARG prometheus_cadvisor_sha256sum=a15ebac9c60cccbb035e4af83cd45211edac19f3204ed0614b3336fddf91444b
{% else %}
ARG prometheus_cadvisor_sha256sum=30602f675e9bcd39b0d4cd4bd9e83c0849dd4bb3a60a0544b9f2a6451a3facfe
{% endif %}
ARG prometheus_cadvisor_url=https://github.com/google/cadvisor/releases/download/v${prometheus_cadvisor_version}/cadvisor-v${prometheus_cadvisor_version}-linux-{{debian_arch}}
{% endblock %}


{% block prometheus_cadvisor_install %}
RUN curl -o /tmp/cadvisor ${prometheus_cadvisor_url} \
    && echo "${prometheus_cadvisor_sha256sum} /tmp/cadvisor" | sha256sum -c \
    && mv /tmp/cadvisor /opt \
    && chmod 0755 /opt/cadvisor
{% endblock %}


{% block prometheus_cadvisor_footer %}{% endblock %}
{% block footer %}{% endblock %}
